package com.android.samples.mediastore.di

import android.content.Context
import com.android.samples.mediastore.hms.drive.utils.CredentialManager
import com.huawei.cloud.services.drive.Drive
import dagger.Module
import dagger.Provides
import dagger.hilt.InstallIn
import dagger.hilt.android.qualifiers.ApplicationContext
import dagger.hilt.components.SingletonComponent
import javax.inject.Singleton


@Module
@InstallIn(SingletonComponent::class)
object AppModule {

    @Provides
    @Singleton
    fun getHmsDrive(@ApplicationContext context: Context): Drive {
        return Drive.Builder(CredentialManager.credential, context).build()
    }
}